package com.xbongbong.saas.model.impl;

import com.xbongbong.paas.toolbox.util.DateTimeUtil;
import com.xbongbong.saas.domain.dao.CustomerStatementProductDao;
import com.xbongbong.saas.domain.entity.CustomerStatementProductEntity;
import com.xbongbong.saas.model.CustomerStatementProductModel;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @Description
 * @author: shian
 * @date : 2020/12/30
 */
@Service("customerStatementProductModel")
public class CustomerStatementProductModelImpl implements CustomerStatementProductModel {
    @Resource
    private CustomerStatementProductDao customerStatementProductDao;

    @Override
    public Integer insert(CustomerStatementProductEntity entity) {
        long now = DateTimeUtil.getInt();
        entity.setAddTime(now);
        entity.setUpdateTime(now);
        return customerStatementProductDao.insert(entity);
    }

    @Override
    public void insertBatch(List<CustomerStatementProductEntity> list) {
        customerStatementProductDao.insertBatch(list);
    }

    @Override
    public List<CustomerStatementProductEntity> findEntitys(Map<String, Object> param) {
        return customerStatementProductDao.findEntities(param);
    }

    @Override
    public Integer getEntitysCount(Map<String, Object> param) {
        return customerStatementProductDao.getEntitiesCount(param);
    }

    @Override
    public List findEntitysWithoutSub(Map<String, Object> param) {
        return null;
    }

    @Override
    public Integer update(CustomerStatementProductEntity entity) {
        return customerStatementProductDao.update(entity);
    }

    @Override
    public CustomerStatementProductEntity getByKey(Long key, String corpid) {
        return customerStatementProductDao.getByKey(key, corpid);
    }

    @Override
    public List<CustomerStatementProductEntity> getByStatementId(String corpid, Long statementId, Integer snapshot) {
        return customerStatementProductDao.getByStatementId(corpid, statementId, snapshot);
    }
}
